<template>
	<view style="background: white;">
		<view class="con-box">
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">运单号： {{ waybillDetail.waybill_sn }} - {{ waybillStatus(waybillDetail) }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="12">
						<view class="name">运单等级：{{ getLevel(waybillDetail)}}</view>
					</uni-col>
					<uni-col :span="12">
						<view class="name">货号：{{ waybillDetail.goodsn }}</view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">开票时间： {{ waybillDetail.createtime_date }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="8">
						<view class="good-item"> <text class="name">货物名称</text></view>
					</uni-col>
					<uni-col :span="4">
						<view class="good-item"> <text class="name">包装</text></view>
					</uni-col>
					<uni-col :span="4">
						<view class="good-item"> <text class="name">数量</text></view>
					</uni-col>
					<uni-col :span="4">
						<view class="good-item"> <text class="name">总(KG)</text></view>
					</uni-col>
					<uni-col :span="4">
						<view class="good-item"> <text class="name">总(方)</text></view>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row" v-for="(goodItem ,row) in waybillDetail.goods" :key="row">
					<uni-col :span="8">
						<text class="value">{{ goodItem.goods_name }}</text>
					</uni-col>
					<uni-col :span="4">
						<text class="value">{{ goodItem.goods_pack }}</text>
					</uni-col>
					<uni-col :span="4">
						<text class="value">{{ goodItem.goods_nums }}</text>
					</uni-col>
					<uni-col :span="4">
						<text class="value"> {{ goodItem.total_weight }}</text>
					</uni-col>
					<uni-col :span="4">
						<text class="value">{{ goodItem.total_volume }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">总费用：￥{{ waybillDetail.all_amount }}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">总运费：￥{{waybillDetail.all_order_amount }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">接货费：￥{{ waybillDetail.pickup_fee}}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">送货费： ￥{{waybillDetail.delivery_fee }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">专线运费：￥{{ waybillDetail.system_line_price }}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">支付类型：{{ getOrderAmountPay(waybillDetail)}}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">开单费：￥0</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">平台操作费：￥0</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<!-- <uni-col span="6">
						<text class="name">实付运费：{{ waybillDetail.advance_amount }}</text>
					</uni-col> -->
					<uni-col :span="24">
						<text class="name">代收货款：{{ waybillDetail.advance_amount }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">起始网点： {{ waybillDetail.start_point_name}}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">目的城市：{{ getDestinationCity(waybillDetail) }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">发货人： {{ waybillDetail.send_username }}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">发货电话：{{ waybillDetail.send_mobile }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">身份证号：{{ waybillDetail.send_card }}</text>
					</uni-col>
				</uni-row> 
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">会员号： {{ waybillDetail.memberno }}</text>
					</uni-col>  
					<uni-col :span="12">
						<text class="name">户名：{{ waybillDetail.send_accountname }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">银行卡号： {{ waybillDetail.send_account }}</text>
					</uni-col> 
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">详细地址：</text>
						<text class="name">{{ waybillDetail.send_address }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">收货人： {{ waybillDetail.take_username }}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">收货电话：{{ waybillDetail.take_mobile }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">身份证： {{ waybillDetail.take_card }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">详细地址： {{ waybillDetail.take_address }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">回单类型： {{ getReceiptType(waybillDetail)}}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">回单数量：{{ waybillDetail.receipt_num }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">是否是急件： {{ getIsUrgency(waybillDetail)}}</text>
					</uni-col>
					<uni-col :span="12">
						<text class="name">等通知放货： {{ getIsControl(waybillDetail)}}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="12">
						<text class="name">异形货物： {{ getIsUnusual(waybillDetail)}}</text>
					</uni-col> 
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">备注：{{ waybillDetail.remark }}</text>
					</uni-col>
				</uni-row>
			</view>
			
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">二级发货凭证：{{ getDepartPic2(waybillDetail) }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="6" 
						v-for="(item,index) in getDepartPic2List(waybillDetail)" 
						:key="index">
						<u-image width="120rpx" height="120rpx" :src="item" @click="imagePicClick('departPic2',index)"></u-image>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">上传时间：{{ waybillDetail.waybill_certificate.depart_certificate_p2_date }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">一级到货凭证：{{ getArrivePic1(waybillDetail) }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="6" 
						v-for="(item,index) in getArrivePic1List(waybillDetail)" 
						:key="index">
						<u-image width="120rpx" height="120rpx" :src="item" @click="imagePicClick('arrivePic1',index)"></u-image>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">上传时间：{{ waybillDetail.waybill_certificate.delivery_certificate_p1_date }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">一级发货凭证：{{ getDepartPic1(waybillDetail) }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="6" 
						v-for="(item,index) in getDepartPic1List(waybillDetail)" 
						:key="index">
						<u-image width="120rpx" height="120rpx" :src="item" @click="imagePicClick('departPic1',index)"></u-image>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">上传时间：{{ waybillDetail.waybill_certificate.depart_certificate_p1_date }}</text>
					</uni-col>
				</uni-row>
			</view>
			
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">分拨中心到货凭证：{{ getAllocatePic1(waybillDetail) }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="6" 
						v-for="(item,index) in getAllocatePic1List(waybillDetail)" 
						:key="index">
						<u-image width="120rpx" height="120rpx" :src="item" @click="imagePicClick('allocatePic1',index)"></u-image>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">上传时间：{{ waybillDetail.waybill_certificate.delivery_certificate_date }}</text>
					</uni-col>
				</uni-row>
			</view>
			<view class="item-view">
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">分拨凭证：{{ getAllocatePic2(waybillDetail) }}</text>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="6" 
						v-for="(item,index) in getAllocatePic2List(waybillDetail)" 
						:key="index">
						<u-image width="120rpx" height="120rpx" :src="item" @click="imagePicClick('allocatePic2',index)"></u-image>
					</uni-col>
				</uni-row>
				<uni-row class="uni-row">
					<uni-col :span="24">
						<text class="name">上传时间：{{ waybillDetail.waybill_certificate.depart_certificate_date }}</text>
					</uni-col>
				</uni-row>
			</view>

			<uni-row class="uni-row">
				<uni-col :span="8" v-if="showDepartBtn()">
					<view class="pay" @click="handleDepart">发货凭证</view>
				</uni-col>
				<uni-col :span="8" v-if="showDeliveryBtn()">
					<view class="pay" @click="handleDelivery">到货凭证</view>
				</uni-col>
				<uni-col :span="8" v-if="showAllocationBtn()">
					<view class="pay" @click="handleAllocation">分拨凭证</view>
				</uni-col>
			</uni-row>
			<uni-row class="uni-row">
				<uni-col :span="24">
					<view style="height: 60rpx;"></view>
				</uni-col>
				 
			</uni-row>
		</view>


	</view>
</template>

<script>
	import orderDetail from '../public/js/order-detail.js';

	export default {
		mixins: [orderDetail], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
		data() {
			return {

			};
		},
		methods: {

		}
	};
</script>

<style lang="scss">
	@import '../public/css/order-detail.scss';
</style>